//------------Sonic CD Vert Platform Script-------------//
//--------Scripted by Christian Whitehead 'The Taxman'--------//
//-------Unpacked By Rubberduckycooly's Script Unpacker-------//

//-------Aliases-------//
#alias 45: TYPE_VERTPLATFORM


sub ObjectMain
	Object.Value3=Oscillation
	Object.Value3<<=1
	if Object.PropertyValue==1
		Object.Value3+=256
	endif
	Sin(Object.Value2,Object.Value3)
	Object.Value2*=6144
	Object.Value2+=Object.YPos
	Object.Value2&=-65536
	Object.Value2-=Object.Value1
endsub


sub ObjectPlayerInteraction
	TempValue0=Object.YPos
	Object.YPos=Object.Value1
	PlayerObjectCollision(C_PLATFORM,-32,-9,32,12)
	if CheckResult==1
		Player.YPos+=Object.Value2
	endif
	Object.YPos=TempValue0
endsub


sub ObjectDraw
	Sin(Object.Value1,Object.Value3)
	Object.Value1*=6144
	Object.Value1+=Object.YPos
	Object.Value1&=-65536
	DrawSpriteXY(0,Object.XPos,Object.Value1)
endsub


sub ObjectStartup
	LoadSpriteSheet("R1/Objects.gif")
	SpriteFrame(-32,-16,64,32,101,109)
endsub

sub RSDK
	LoadSpriteSheet("Global/Display.gif")
	SetEditorIcon(Icon0,SingleIcon,-16,-16,32,32,1,143)
endsub
